import request from '../../utils/request';
let baseRequest_url = "http://127.0.0.1:4890/portal";
//  --------------------------------------------------------------------------------------------------------------- //
// 优惠券列表分页查询
export const findCouponListPage = query => {
    return request({
        url: baseRequest_url+'/admin/coupon/findCouponListPage',
        method: 'get',
		params: query,
    });
};
// 优惠券详情查询
export const findCouponInfoById = query => {
    return request({
        url: baseRequest_url+'/admin/coupon/info/'+query,
        method: 'get',
		params: query,
    });
};
// 新增优惠券
export const addCoupon = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/saveCouponInfo',
        method: 'post',
		data: data,
    });
};
// 编辑优惠券
export const saveCoupon = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/saveCouponInfo',
        method: 'put',
		data: data,
    });
};
// 删除优惠券
export const deleteCouponById = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/deleteCouponById/'+data,
        method: 'delete',
    });
};
// 批量删除优惠券
export const batchDeleteCoupon = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/deleteCoupon',
        method: 'delete',
        data: data
    });
};
// 批量编辑优惠券状态
export const batchEditCouponStatus = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/batchEditCouponStatus',
        method: 'put',
        data: data
    });
};
// 优惠券分配
export const allocationCoupon = data => {
    return request({
        url: baseRequest_url+'/admin/coupon/allocationCoupon',
        method: 'put',
        data: data
    });
};